<template>
    <div class="foot">
        <van-submit-bar class="submit" :price="this.$store.state.shoppingPrice" button-text="提交订单">
  <van-checkbox v-model="checked">全选</van-checkbox>
  <template #tip>
    你的收货地址不支持同城送, <span>修改地址</span>
  </template>
</van-submit-bar>
    </div>
</template>

<script>
export default {
  data () {
    return {
      checked: false,
      value: this.$store.state.shoppingList
    }
  },
  mounted () {
    if (this.$store.state.shoppingList.length == 0) {
      this.checked = false
    }
    // 当选中商品等于商品数量市全选为选中状态,没有商品选中为未选中状态
    this.$bus.$on('check1', (data1, data2) => {
      // console.log(data1,data2)
      if (data1 == data2) {
        this.checked = true
      } else if (data1 == 0) {
        this.checked = false
      }
    })
  },
  watch: {
    checked () {
      this.$bus.$emit('checked', this.checked)
    }
  }
}
</script>
<style>
.van-button--danger .van-button__text{
  color: rgb(223, 234, 243);
}
</style>
<style scoped>
.foot{
  width: 100%;
  height: 3rem;
  position: fixed;
  bottom: 3.5rem;
  background-color: antiquewhite;
}
.submit{
    position: absolute;
}
</style>
